<?php
	$token = $_POST['token'];
	$left = trim($_POST['left']);
	$tid = $_POST['tid'];
	$tName = $_POST['tName'];
	if($tid == 'all' || !$tid || !$tName || !$left || !$token){
		exit('parm is error!');
	}


	require '../autoload.php';

	//token验证
	if(!token_v('infoDel',$token)){
		exit('token is error');
	}

	$mp = new MyPdo();
	$sql = "delete from translate_info where typeid = ? and lefts = ?";
	$arr = array($tid,$left);
	//var_dump($arr);exit;
	$res = $mp->dml($sql,$arr);
	if(!$res['error']){
		echo '删除成功！';
		$sql = 'select id from translate_not_join where tid = ?';
		$res = $mp->dql($sql,array($tid));
		if(!$res){
			$fileName[] = '../Runtime/Cache_long/all';
			//$fileName[] = '../Runtime/CacheLefts/'.md5('all');
		}
		$fileName[] = '../Runtime/Cache_long/'.$tName;
		//$fileName[] = '../Runtime/CacheLefts/'.$tName;
		$fileName[] = '../Runtime/CacheInfoAll/'.$tName;
		$fileName[] = '../Runtime/CacheRight/'.$tName.'/'.md5($left);
		$fileName[] = '../Runtime/CacheLeftVague/'.$tName;
		$fileName[] = '../Runtime/CacheRightVague/'.$tName;
		foreach($fileName as $v){
			rmdirs($v);	
		}
	}else{
		echo '删除失败';
	}

